using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class IllustrationConfiguration : EntityTypeConfiguration<Illustration>
    {
        public IllustrationConfiguration()
        {
            ToTable("Production.Illustration");
            HasKey(x => x.IllustrationId);

            Property(x => x.IllustrationId)
                .HasColumnName("IllustrationID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.Diagram).HasColumnName("Diagram").IsOptional();
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}